home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / stdg44.exe / lha / BULLMAIN.C < prev    next >
C/C++ Source or Header  |  1994-01-10  |  2KB  |  56 lines

  1. /*  Bullseye by Loki  */
  2.  
  3. #include "stdg.h"
  4. #include "bullseye.h"
  5.  
  6. void about_bullseye(void)
  7. {
  8.     mouse m;
  9.     window *w = new_window("About Bullseye...", rdiag(25,25,120,50), Modal);
  10.  
  11.     show_window(w);
  12.  
  13.     draw_rect(w->b, insetr(w->b->r, 1), 1, BLACK);
  14.  
  15.     draw_string(w->b, pt(17,7), sys_font, "Stdg Bullseye", BLUE);
  16.     draw_string(w->b, pt(34,27), sys_font, "by Loki", BLUE);
  17.  
  18.     do { m = get_mouse(w);} while (!(m.kind & MouseDown)); /* mouse down */
  19.     do { m = get_mouse(w);} while (!(m.kind & MouseUp));   /* mouse up */
  20.  
  21.     hide_window(w);
  22.     del_window(w);
  23. }
  24.  
  25. int main(int argc, char **argv)
  26. {
  27.     mouse m;
  28.     window *w;
  29.  
  30.     /* Initialise our Bullseye menus. See "bullmenu.c" for details */
  31.     menuinit();
  32.  
  33.     /* Initialise the Stdg graphics interface, and supply our menubar */
  34.     ginit("Bullseye", &adjust_menus, menubar);
  35.  
  36.     /* Now we set up our own About Bullseye... function */
  37.     set_aboutbox(&about_bullseye);
  38.  
  39.     /* Create a workspace window and show it on the screen */
  40.     w = new_window("Bullseye by Loki", rect(6,44,630,420),
  41.                     Titlebar | Closebox | Maximize | Resize | Workspace);
  42.     show_window(w);
  43.  
  44.     /* Now we handle events, but let the menus do most of the work */
  45.  
  46.     while(1) {
  47.         if (can_event() && ((w = active_window) != NULL))
  48.             if (can_mouse(w))
  49.             {
  50.                 m = get_mouse(w);
  51.                 if (m.kind & MouseUp)   /* just saw a mouse up event */
  52.                     hit_window(w);      /* tell the window to redraw */
  53.             }
  54.     }
  55. }
  56.